feat(agent): add order field for configurable agent cycling order#24690
feat(agent): add order field for configurable agent cycling order#24690LCubero wants to merge 1 commit intoanomalyco:devfrom
Conversation
Adds an optional `order` field (PositiveInt) to agent config so users and plugins can control Tab cycling order. Sorting in Agent.list() becomes: 1. Default agent first (unchanged) 2. By order ascending (new) 3. By name ascending (unchanged fallback) Fully backward-compatible — agents without `order` behave as before. Closes anomalyco#7372
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate PRs FoundBased on my search, I found 3 potentially related PRs:
Why they're related: All three PRs are implementing the same feature - adding an |
Closes #7372
Adds an optional
orderfield (PositiveInt) to agent config so users and plugins can control Tab cycling order instead of being forced into alphabetical sort.Currently
Agent.list()sorts agents alphabetically by name (after default agent). This breaks plugins that define multiple agents with a specific intended order.The fix adds
order(positive integer, optional) to bothConfigAgent.InfoandAgent.Info. Sorting becomes:orderascending (new)Changes
packages/opencode/src/config/agent.ts: Addorderto AgentSchema + KNOWN_KEYSpackages/opencode/src/agent/agent.ts: Addorderto Info schema, merge logic, and sortBypackages/opencode/test/agent/agent.test.ts: Add 2 tests for order field sortingHow verified